﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace ShopzillaV1.Models
{
    [XmlRoot("ProductResponse")]
    public class ProductResponse
    {
       
        //[XmlElement("PriceSet")]
        //public PriceSet PriceSet { get; set; }
        [XmlElement("Products")]
        public PagingInfo PagingInfo { get; set; }

        

    }

    [XmlRoot("Products")]
    public class PagingInfo
    {     

        [XmlAttribute("totalResults")]
        public int TotalResults { get; set; }


        [XmlAttribute("includedResults")]
        public int IncludedResults { get; set; }

        //[XmlArray()]
        [XmlElement("Product")]
        public List<Product> Products { get; set; }


    }

    [XmlRoot("Product")]
    public class Product
    {
        [XmlAttribute("id")]
        public string ID { get; set; }

        [XmlAttribute("categoryId")]
        public string CategoryID { get; set; }

        [XmlElement("title")]
        public string Title { get; set; }

        [XmlElement("description")]
        public string Description { get; set; }

        [XmlElement("url")]
        public string Url { get; set; }

        [XmlArray("Images")]
        [XmlArrayItem("Image")]
        public List<Image> Images { get; set; }

        [XmlElement("PriceSet")]
        public PriceSet PriceSet { get; set; }


    }

    [XmlRoot("PriceSet")]
    public class PriceSet
    {
        [XmlElement("minPrice")]
        public string MinPrice { get; set; }

        [XmlElement("maxPrice")]
        public string MaxPrice { get; set; }

        [XmlElement("stores")]
        public int Stores { get; set; }
    }

    [XmlRoot("Image")]
    public class Image
    {
        [XmlText()]
        public string Url { get; set; }

        [XmlAttribute("xsize")]
        public string Width { get; set; }

        [XmlAttribute("ysize")]
        public int Height { get; set; }
    }
}